package com.chemical.search.model;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 *@className:Menu.java
 *@classDescription:
 *@author:MChen
 *@createTime:2012-5-31
 */
@Entity
@Table(name = "function_name")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Menu implements java.io.Serializable{
	
	private static final long serialVersionUID = -4522259504634124036L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer function_id;     // 主键id
	@Column(name="function_name",length=50,nullable=false)
	private  String function_name;   //显示名称
	@Column(name="parentId",nullable=false)
	private  int parentId=0;         //父id,如果为顶级菜单则为0
	@Column(name="function_url",length=200,nullable=false)
	private  String function_url;    //链接url
	@Column(name="function_desc",length=200,nullable=false)
	private  String function_desc;	 //image链接url
	@Column (name = "iseffective")
	private  int iseffective;		 //该功能是否有效
	@Transient
	private List<Menu> childList = new ArrayList<Menu>();//子菜单
	
	public Integer getFunction_id() {
		return function_id;
	}
	public void setFunction_id(Integer functionId) {
		function_id = functionId;
	}
	public String getFunction_name() {
		return function_name;
	}
	public void setFunction_name(String functionName) {
		function_name = functionName;
	}
	public int getParentId() {
		return parentId;
	}
	public void setParentId(int parentId) {
		this.parentId = parentId;
	}
	public String getFunction_url() {
		return function_url;
	}
	public void setFunction_url(String functionUrl) {
		function_url = functionUrl;
	}
	public String getFunction_desc() {
		return function_desc;
	}
	public void setFunction_desc(String functionDesc) {
		function_desc = functionDesc;
	}
	public int getIseffective() {
		return iseffective;
	}
	public void setIseffective(int iseffective) {
		this.iseffective = iseffective;
	}
	public List<Menu> getChildList() {
		return childList;
	}
	public void setChildList(List<Menu> childList) {
		this.childList = childList;
	}
}
